import React, { Component } from 'react';
import DomHelper from './domHelper';
import classNames from 'classnames';

class Loading extends Component {

    constructor(props) {
        super(props);
        this.state = {
            isLoading: false
        };
    }

    componentDidMount() {
        DomHelper.loading = {
            show: (content) => this.show(content),
            hide: () => this.hide()
        }
    }

    render() {
        let loadingClasses = classNames('loading-wrap', !this.state.isLoading ? 'hide' : '')
        return ( 
        	<div className={loadingClasses}>
            	<div className="loading-content">
            		<img src='/static/new_version/image/loading.svg' />
            		<span> 请求中, 请稍候... </span>
            	</div>
            </div>
        )
    }
}

export default Loading;
